<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="taglibs.jsp"%>
<%@ include file="RolePowerManager.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	
  <link rel="stylesheet" href="${ctx}/css/common.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/reset.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/Train/floatdiv.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/Train/TrainManager.css" type="text/css"></link>
  
    <script type="text/javascript" src="${ctx}/js/jquery-1.7.2.js"></script>
  <script type="text/javascript" src="${ctx}/js/jquery.easydrag.handler.beta2.js"></script>
    <script type='text/javascript' src='${ctx}/dwr/interface/TrainTypeManager.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/TrainPropertyManager.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/TeacherManager.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/CourseManager.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/TrainWayManager.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/dwrTrainManager.js'></script>

	<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
	<script type='text/javascript' src='${ctx}/dwr/util.js'></script>
	<script type="text/javascript" src="${ctx}/js/Train/TrainManager.js"></script>  
  <script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
  </head>
  <body>
  	  <div class="head">
  		<div class="curloc"><span>当前位置: 教育培训 >> 培训项目维护</span></div>
  	  </div>
  	  <form action="FindTrainServlet" method="post" id="searchform">
	  <div class="query" >
	  <div class="querytype">
	  	<label>查询条件：</label>
	  	
	  	<select class="queryselect" name="serchtype" id="serchtype" onclick="changesearchtype()">
			<option value="trainname">
			培训名称
			</option >
			<option value="time">
			起始时间
			</option >
			<option value="trainType">
			培训类型
			</option>
			<option value="trainProperty">
			培训性质
			</option>
			<option value="trainWay">
			培训方式
			</option>
		</select>
		<span id="searchtypeoption" style="display: none">
			<select class="queryselect" id="idkeycode" name="idkeycode" >
			<option value="0">
			--请选择--
			</option>
		</select>
		</span>
		<span id="searchtinput" >
		<input class="queryinput" type="text" name="keycode" size="12"/>
		</span>
	  </div>
	  <input type="hidden"  id="searchtimeflag" name="searchtimeflag" value="0"/>
	  <div class="querytime">
	  	<label >培训时间：</label>
	  	<div class="selecttime">
	  		<label>起始：<input type="text"  id="searchstarttime" name="starttime" onClick="WdatePicker()" size="10"/> </label>
	  		<label>结束：<input type="text"  id="searchendtime" name="endtime" onClick="WdatePicker()" size="10"/> </label>
	  	</div>
	  	<div class="querybtn" onclick="search()">
	  		<span class="STYLE1"><img src="${ctx}/images/a1.gif" width="9" height="9" /></span>
            <span class="STYLE1"> </span><a style="cursor: pointer;">查询</a><span class="STYLE1"></span>
	  	</div>
      </div>
   
      <div style="float: right; padding-right: 20px">
	  			<span class="STYLE1"><img src="${ctx}/images/001.gif" width="9" height="9" /></span>
            	<span class="STYLE1"> </span><a onclick="popadd()" href="#">新增</a><span class="STYLE1"></span>
	  	</div>
	  <div class="clear"> </div>
	  </div>
      </form>
        <div id="main">
        <table id="detail_t">
          <tr>
          	<th>序号</th>
          	<th>培训编号</th>              
            <th>培训名称</th>            
            <th>培训性质</th>
            <th>培训类型</th>
            <th>培训方式</th>
            <th>培训费用</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>负责人</th>
            <th>更多操作</th>
          </tr>
         <c:forEach items="${page.list}" var="t" varStatus="status">
    	<tr>
    	<td>${status.count}</td>
    	<td>${t.id}</td>
    	<td>${t.trainname}</td>
    	<td>${t.trainProperty.propertyname}</td>   	
    	<td>${t.trainType.typename}</td>
    	<td>${t.trainWay.wayname}</td>
    	<td>${t.money}</td>
    	<td>${t.starttime}</td>
    	<td>${t.endtime}</td>
    	<td>${t.manager.name}</td>
    	<td>
    	<div align="center">
            <span class="STYLE1"><img src="${ctx}/images/037.gif" width="9" height="9" /></span>
            <span class="STYLE1"> [</span><a href="#" onclick="clickUpdateTrain('${t.id}')">详情/修改</a><span class="STYLE1">]</span>
            &nbsp;&nbsp;&nbsp;
            <span class="STYLE2"><img src="${ctx}/images/010.gif" width="9" height="9" /></span>
            <span class="STYLE2"> </span><span class="STYLE1">[</span><a href="#" onclick="deleteTrain('${t.id}')">删除</a><span class="STYLE1">]</span>
            </div>
    	</td>
    </tr>
    </c:forEach>
          
         
         
        </table>
			 <div class="manu">共${page.totalCount}条记录当前第<font color="#ff6600">${page.pageNo}/${page.pageCount}</font>页
				 <a href="FindTrainServlet?pageNo=${1}">首页</a>
				  <a href="FindTrainServlet?pageNo=${page.pageNo-1}">上一页</a>
				  <a href="FindTrainServlet?pageNo=${page.pageNo+1}">下一页</a>
				  <a href="FindTrainServlet?pageNo=${page.pageCount}">末页</a> 每页显示
				  <input type="text" name="pageSize"  id="pageSize" size="4"/>条
				  <input type="submit" value="提交" class="submitbuttton" onclick="changePageSize()"/> 
			</div>
		</div>   
        
        
        <div id="UpdateTrain_div">
			<div id="UpdateTrain_head" class="div_head">
				<span class="div_title">培训项目详情/修改</span> <span><a
					class="div_close" onclick="closediv()" title="close">X</a>
				</span>
			</div>
			<div id="UpdateTrain_box_body" >
				<div class="p_con">
				<form action="${ctx}/UpdateTrainServlet" method="post" id="updatetrainform">
					<table id="detail_t" width="100%">
    				<tr>
   				 		<td>培训名称：<input type="hidden" name="trainid" id="uptrainid"/></td>
 		  		 		<td><input type="text" name="trainname" id="uptrainname" onblur="upchecktrainname()" />
			    		<span class="error" id="uptrainnameerr"></span>
			    		</td>
 					</tr>
 			   		
 			  	 	<tr>
   	 						<td>培训类型</td>
 					   		<td>
  					  		<select name="traintype" id="uptraintype" onblur="upchecktraintype()">
  				  			<option value="0">--请选择--</option>
    						</select>
    						<span class="error" id="uptraintypeerr"></span>
 					   		</td>
 				   	</tr>
    				<tr>
  				 	 	<td>培训性质</td>
   				 		<td>
 				   		<select name="trainProperty" id="uptrainProperty" onblur="upchecktrainProperty()">
    					<option value="0">--请选择--</option>
 				   		</select>
 				   		<span class="error" id="uptrainPropertyerr"></span>
  				  		</td>
  				  	</tr>
  				  	
  				  	<tr>
  				 	 	<td>培训方法</td>
   				 		<td>
 				   		<select name="trainWay" id="uptrainWay" onblur="upchecktrainWay()">
    					<option value="0">--请选择--</option>
 				   		</select>
 				   		<span class="error" id="uptrainWayerr"></span>
  				  		</td>
  				  	</tr>
  				  	
    				<tr>
   				 		<td>培训地点</td>
 				   		<td>
 				   		<input type="text" name="address" id="upaddress"onblur="upcheckaddress()">
 				   		<span class="error" id="upaddresserr"></span>
 				   		</td>
    				</tr>
    				<tr>
    					<td>开始时间</td>
    					<td>
    					<input type="text" id="upstarttime" name="starttime" onClick="WdatePicker()" onblur="upcheckstarttime()">
    					<span class="error" id="starttimeerr"></span>
    					</td>
    				</tr>
    				<tr>
    					<td>结束时间</td>
  				  		<td>
  				  		<input type="text" name="endtime" id="upendtime" onClick="WdatePicker()" onblur="upcheckendtime()">
  				  		<span class="error" id="upendtimeerr"></span>
  				  		</td>
 				   	</tr>
   				 	<tr>
    					<td>培训费用</td>
    					<td>
    					<input type="text" name="money" id="upmoney" onblur="upcheckmoney()">
    					<span class="error" id="upmoneyerr"></span>
    					</td>
    				</tr>
   				 	<tr>
  				  		<td>培训单位</td>
   				 		<td>
   				 		<input type="text" name="organization" id="uporganization" onblur="upcheckorganization()">
   				 		<span class="error" id="uporganizationerr"></span>
   				 		</td>
  				  	</tr>
   				 	<tr>
   				 		<td>负责人</td>
  				  		<td>
  				  		<span id="upmanager">
  				  		</span>
  				  		</td>
 				   	</tr>
 				   	<tr  class="upcourse">    				
    				</tr>	
  				  	<tr>
    					<td colspan="2">
    					<span style="float: right;margin-right: 30px">
    					<input type="reset" value="重置" class="submitbuttton"/>
    					<input type="button" value="修改" onclick="updateTrain()" class="submitbuttton"/>
    					</span>
    					</td>
 				   	</tr>
       				 </table>
       				 </form>
				</div>
			</div>
		</div>
		<div id="AddTrain_div">
			<div  class="div_head" id="AddTrain_head">
				<span class="div_title">培训项目添加</span> <span><a
					class="div_close" onclick="hideDiv('AddTrain_div');" title="close">X</a>
				</span>
			</div>
			<div  id="AddTrain_box_body">
				<form action="${ctx}/AddTrainServlet" method="post" id="addtrainform">
					<table id="detail_t" width="100%">
    				<tr>
    				
   				 		<td>培训名称：</td>
 		  		 		<td><input type="text" name="trainname" id="trainname" onblur="checktrainname()" />
			    		<span class="error" id="trainnameerr"></span>
			    		</td>
 					</tr>
 			   		
 			  	 	<tr>
   	 						<td>培训类型</td>
 					   		<td>
  					  		<select name="traintype" id="traintype" onblur="checktraintype()">
  				  			<option value="0">--请选择--</option>
    						</select>
    						<span class="error" id="traintypeerr"></span>
 					   		</td>
 				   	</tr>
    				<tr>
  				 	 	<td>培训性质</td>
   				 		<td>
 				   		<select name="trainProperty" id="trainProperty" onblur="checktrainProperty()">
    					<option value="0">--请选择--</option>
 				   		</select>
 				   		<span class="error" id="trainPropertyerr"></span>
  				  		</td>
  				  	</tr>
  				  	
  				  	<tr>
  				 	 	<td>培训方法</td>
   				 		<td>
 				   		<select name="trainWay" id="trainWay" onblur="checktrainWay()">
    					<option value="0">--请选择--</option>
 				   		</select>
 				   		<span class="error" id="trainWayerr"></span>
  				  		</td>
  				  	</tr>
  				  	
    				<tr>
   				 		<td>培训地点</td>
 				   		<td>
 				   		<input type="text" name="address" id="address"onblur="checkaddress()">
 				   		<span class="error" id="addresserr"></span>
 				   		</td>
    				</tr>
    				<tr>
    					<td>开始时间</td>
    					<td>
    					<input type="text" id="starttime" name="starttime" onClick="WdatePicker()" onblur="checkstarttime()">
    					<span class="error" id="starttimeerr"></span>
    					</td>
    				</tr>
    				<tr>
    					<td>结束时间</td>
  				  		<td>
  				  		<input type="text" name="endtime" id="endtime" onClick="WdatePicker()" onblur="checkendtime()">
  				  		<span class="error" id="endtimeerr"></span>
  				  		</td>
 				   	</tr>
   				 	<tr>
    					<td>培训费用</td>
    					<td>
    					<input type="text" name="money" id="money" onblur="checkmoney()">
    					<span class="error" id="moneyerr"></span>
    					</td>
    				</tr>
   				 	<tr>
  				  		<td>培训单位</td>
   				 		<td>
   				 		<input type="text" name="organization" id="organization" onblur="checkorganization()">
   				 		<span class="error" id="organizationerr"></span>
   				 		</td>
  				  	</tr>
   				 	<tr>
   				 		<td>负责人</td>
  				  		<td>
  				  		<input type="text" name="manager" id="manager" onblur="checkmanager()">
  				  		<span class="error" id="managererr"></span>
  				  		</td>
 				   	</tr>
    				 <tr id="course" class="course">
    					<td>科目</td>
   				 		<td><select name="course" id="courses">
   				 			<option value="0">--请选择--</option>
 				   		</select>
    						所占比重<input type="text" name="percent" size="4">
    							讲师<select name="teacher" id="teacher">
    						<option value="0">--请选择--</option>
   				 		</select>
   			 		</td>
  				  	</tr>
   				 	<tr id="courseheight">
   				 	<td>科目增减</td>
			    		<td>
			    		<span>
			    		<input type="button" value="增加科目" onclick="addCourseInput()" style="height:24px;width:60px;">
			    		<input type="button" value="删除最后一科" onclick="deleteCourseInput()" style="height:24px;width:80px;">
			    		</span>
			    		</td>
 				   	</tr>
  				  	<tr>
    					<td colspan="2">
    					<span style="float: right;margin-right: 30px">
    					<input type="reset" value="重置" class="submitbuttton"/>
    					<input type="button" value="提交" onclick="addTrain()" class="submitbuttton"/>
    					</span>
    					</td>
 				   	</tr>
       				 </table>
       				 </form>
				
			</div>
		</div>
        
  </body>
</html>
